{php include wl_template('common/header');}
<ul class="nav nav-tabs" id="myTab">
    <li><a href="javascript:;">销售详情</a></li>
</ul>
<div class="app-content">
    <div class="app-filter">
        <div class="filter-list">
            <form action="" method="get" class="form-horizontal" role="form" id="form1">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="{MODULE_NAME}" />
                <input type="hidden" name="p" value="order" />
                <input type="hidden" name="ac" value="wlOrder" />
                <input type="hidden" name="do" value="checkcodeList" />
                <input type="hidden" name="id" value="{$id}" />
                <input type="hidden" name="plugin" value="{$plugin}" />
                <input type="hidden" name="type" value="{$type}" />
                <input type="hidden" name="status" value="{$status}" />
                <div class="form-group">
                    <label class="col-sm-2 control-label">商品信息</label>
                    <div class="col-sm-9">
                        <img src="{$goodinfo['thumb']}" style="width: 30px;height: 30px;"> {$goodinfo['name']}(ID:{$id})
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">商户</label>
                    <div class="col-sm-9">
                        <img src="{$merchant['logo']}" style="width: 30px;height: 30px;"> {$merchant['storename']}(SID:{$goodinfo['sid']})
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">销售类型</label>
                    <div class="col-sm-9">
                        <div class="btn-group">
                            <a href="{php echo wl_filter_url('type:1');}" class="btn {if $type == 1}btn-primary{else}btn-default{/if}">核销订单</a>
                            {if $plugin != 'coupon' && $plugin != 'activity'}
                            <a href="{php echo wl_filter_url('type:2');}" class="btn {if $type == 2}btn-primary{else}btn-default{/if}">其他订单</a>
                            {/if}
                            {if $plugin == 'wlfightgroup'}
                            <a href="{php echo wl_filter_url('type:3');}" class="btn {if $type == 3}btn-primary{else}btn-default{/if}">组团中订单</a>
                            {/if}
                        </div>
                    </div>
                </div>
                {if $type != 3}
                <div class="form-group">
                    <label class="col-sm-2 control-label">销售状态</label>
                    <div class="col-sm-9">
                        <div class="btn-group">
                            <a href="{php echo wl_filter_url('status:1');}" class="btn {if $status == 1}btn-primary{else}btn-default{/if}">已下单</a>
                            <a href="{php echo wl_filter_url('status:2');}" class="btn {if $status == 2}btn-primary{else}btn-default{/if}">已支付</a>
                            <a href="{php echo wl_filter_url('status:3');}" class="btn {if $status == 3}btn-primary{else}btn-default{/if}">已完成</a>
                            <a href="{php echo wl_filter_url('status:4');}" class="btn {if $status == 4}btn-primary{else}btn-default{/if}">已退款</a>
                        </div>
                    </div>
                </div>
                {/if}
                <div class="form-group form-inline">
                    <label class="col-sm-2 control-label">筛选</label>
                    <div class="col-sm-9">
                        <select name="keywordtype" class="form-control">
                            <option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>订单号</option>
                            {if $type == 1}
                            <option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>核销码</option>
                            {/if}
                            <option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>购买人昵称</option>
                            <option value="4" {if $_GPC['keywordtype']==4}selected="selected"{/if}>购买人MID</option>
                            <option value="5" {if $_GPC['keywordtype']==5}selected="selected"{/if}>规格spid</option>
                        </select>
                        <input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}"  placeholder="请输入关键字"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">时间</label>
                    <div class="col-sm-9">
                        <select name="timetype" class="form-control" style = "width:120px;display:inline-block;">
                            <option value="0" {if $_GPC['timetype']==0 || empty($_GPC['timetype'])}selected="selected"{/if}>关闭</option>
                            <option value="1" {if $_GPC['timetype']==1}selected="selected"{/if}>支付时间</option>
                            {if $type == 1}
                            <option value="2" {if $_GPC['timetype']==2}selected="selected"{/if}>核销时间</option>
                            {else if $type == 2}
                            <option value="3" {if $_GPC['timetype']==3}selected="selected"{/if}>发货时间</option>
                            <option value="4" {if $_GPC['timetype']==4}selected="selected"{/if}>收货时间</option>
                            {else}
                            <option value="5" {if $_GPC['timetype']==5}selected="selected"{/if}>即将失败时间</option>
                            {/if}
                        </select>
                        {php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d',$starttime), 'endtime' => date('Y-m-d', $endtime)));}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label"></label>
                    <div class="col-sm-9">
                        <button class="btn btn-primary" id="search">筛选</button>
                        <button class="btn btn-default min-width" name="export" type="submit" value="export"><i class="fa fa-download"></i>  导出记录</button>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label"></label>
                    <div class="col-sm-9">
                        <div>共计商品<span style="color:red;">{$tatal}</span>个</div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="app-table-list">
        {if $type == 1}
        <div class="table-responsive">
            <table class="table table-hover">
                <thead class="navbar-inner">
                <tr>
                    <th style="width:15%;">订单编号</th>
                    <th style="width:5%;">规格</th>
                    <th style="width:15%;">用户信息</th>
                    <th style="width:10%;">核销码</th>
                    <th style="width:5%;">订单金额</th>
                    <th style="width:5%;">状态</th>
                    <th style="width:10%;">核销时间</th>
                    <th style="width:5%;">核销方式</th>
                    <th style="width:15%;">核销员</th>
                    <th style="width:10%;">创建时间</th>
                    <th style="width:5%;">操作</th>
                </tr>
                </thead>
                <tbody>
                {loop $list $de}
                <tr>
                    <td>{$de['orderno']}</td>
                    <td>{$de['specname']}</td>
                    <td><img src="{$de['avatar']}" style="width: 30px;height: 30px;"> {$de['nickname']}(MID:{$de['mid']})</td>
                    <td>{$de['checkcode']}</td>
                    <td>￥{$de['orderprice']}</td>
                    <td>
                        <span class="label label-{$de['statuscss']}">{$de['statustext']}</span>
                    </td>
                    <td style="color: red;">
                        {if $de['hexiaotime']>0}
                        {$de['hexiaotime']}
                        {else}
                            - 无 -
                        {/if}
                    </td>
                    <td style="color: green;">
                        {if $de['hexiaotype']>0}
                        <span class="label label-{$de['hxtypecss']}">{$de['hxtypetext']}</span>
                        {else}
                        - 无 -
                        {/if}
                    </td>
                    <td>
                        {if $de['hxuid']>0}
                        <img src="{$de['hxuserimg']}" style="width: 30px;height: 30px;"> {$de['hxuser']}
                        {else}
                        - 无 -
                        {/if}
                    </td>
                    <td>{$de['createtime']}</td>
                    <td><a href="{$de['orderurl']}">查看订单</a></td>
                </tr>
                {/loop}
                </tbody>
            </table>
        </div>
        {else if $type == 2}
        <div class="table-responsive">
            <table class="table table-hover">
                <thead class="navbar-inner">
                <tr>
                    <th style="width:15%;">订单编号</th>
                    <th style="width:10%;">规格</th>
                    <th style="width:15%;">用户信息</th>
                    <th style="width:10%;">商品数量</th>
                    <th style="width:5%;">支付金额</th>
                    <th style="width:5%;">状态</th>
                    <th style="width:8%;">支付时间</th>
                    <th style="width:8%;">发货时间</th>
                    <th style="width:8%;">收货时间</th>
                    <th style="width:8%;">下单时间</th>
                    <th style="width:8%;">操作</th>
                </tr>
                </thead>
                <tbody>
                {loop $list $de}
                <tr>
                    <td>{$de['orderno']}</td>
                    <td>{$de['specname']}</td>
                    <td><img src="{$de['avatar']}" style="width: 30px;height: 30px;"> {$de['nickname']}(MID:{$de['mid']})</td>
                    <td>{$de['num']}</td>
                    <td>￥{$de['price']}</td>
                    <td>
                        <span class="label label-{$de['statuscss']}">{$de['statustext']}</span>
                    </td>
                    <td style="color: red;">
                        {if $de['paytime']>0}
                        {$de['paytime']}
                        {else}
                        - 无 -
                        {/if}
                    </td>
                    <td style="color: green;">
                        {if $de['sendtime']>0}
                        {$de['sendtime']}
                        {else}
                        - 无 -
                        {/if}
                    </td>
                    <td>
                        {if $de['receivetime']>0}
                        {$de['receivetime']}
                        {else}
                        - 无 -
                        {/if}
                    </td>
                    <td>{$de['createtime']}</td>
                    <td><a href="{$de['orderurl']}">查看订单</a></td>
                </tr>
                {/loop}
                </tbody>
            </table>
        </div>
        {else}
        <div class="table-responsive">
            <table class="table table-hover">
                <thead class="navbar-inner">
                <tr>
                    <th style="width:15%;">订单编号</th>
                    <th style="width:10%;">规格</th>
                    <th style="width:15%;">用户信息</th>
                    <th style="width:10%;">商品数量</th>
                    <th style="width:5%;">支付金额</th>
                    <th style="width:5%;">状态</th>
                    <th style="width:10%;">支付时间</th>
                    <th style="width:10%;">预计失败时间</th>
                    <th style="width:10%;">下单时间</th>
                    <th style="width:10%;">操作</th>
                </tr>
                </thead>
                <tbody>
                {loop $list $de}
                <tr>
                    <td>{$de['orderno']}</td>
                    <td>{$de['specname']}</td>
                    <td><img src="{$de['avatar']}" style="width: 30px;height: 30px;"> {$de['nickname']}(MID:{$de['mid']})</td>
                    <td>{$de['num']}</td>
                    <td>￥{$de['price']}</td>
                    <td>
                        <span class="label label-{$de['statuscss']}">{$de['statustext']}</span>
                    </td>
                    <td style="color: red;">
                        {if $de['paytime']>0}
                        {$de['paytime']}
                        {else}
                        - 无 -
                        {/if}
                    </td>
                    <td>
                        {if $de['failtime']>0}
                        {$de['failtime']}
                        {else}
                        - 无 -
                        {/if}
                    </td>
                    <td>{$de['createtime']}</td>
                    <td><a href="{$de['orderurl']}">查看订单</a></td>
                </tr>
                {/loop}
                </tbody>
            </table>
        </div>
        {/if}
        <div class="app-table-foot clearfix">
            <div class="pull-left">

            </div>
            <div class="pull-right">
                {$pager}
            </div>
        </div>
    </div>
</div>
{php include wl_template('common/footer');}